#!/usr/bin/env python

import nltk
from nltk.corpus import brown
from nltk import word_tokenize
from nltk import FreqDist
from nltk import bigrams
from nltk import ConditionalFreqDist
from collections import defaultdict

brown_news_tagged = brown.tagged_words(categories='news')

#--- get the most common tag ==NN
# tags = [t for (w,t) in brown_news_tagged ]
# fdist = FreqDist(tags)
# print fdist.most_common()
# print fdist.max()


brown_tagged_sents = brown.tagged_sents(categories='news')
brown_sents = brown.sents(categories='news')

raw = 'I do not like green eggs and ham, I do not like them Sam I am!'
tokens = word_tokenize(raw)
# print tokens
default_tagger = nltk.DefaultTagger('NN')
wt1 = default_tagger.tag(tokens)
# print wt1